Update ls command to recurse all objects if -r flag is provided with no bucket#57
Conversation
…no bucket This brings rc more in line with mc's behaviour, specifically when using the recursive flag. No other behaviour changes other than if you provide the -r flag with an alias but no bucket specified. Previously this would have listed just the buckets (same as without the flag), now it lists all objects on the server.
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Updates the CLI ls command to match mc behavior by recursing through all buckets when -r/--recursive is provided with an alias but no bucket, and refactors object listing pagination into a shared helper.
Changes:
- Add
ls -r <alias>behavior to list objects across all buckets instead of listing buckets only. - Introduce
list_all_objectsto enumerate buckets then recursively list objects per bucket. - Extract pagination logic into
list_objects_with_pagingto reuse in both single-bucket and all-buckets listing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0cc46fa7b4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Iterating over HashMap in the text output path (for (bucket_name, objects) in all_items) produces a non-deterministic bucket order between runs, which can make CLI output harder to read and test. If you keep the bucket grouping, consider using an order-preserving structure (e.g., Vec in list_buckets() order, or BTreeMap) so output is stable. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Simon <266044650+Simon9870@users.noreply.github.com>
|
@overtrue I have addressed all comments |
This brings rc more in line with mc's behaviour, specifically when using the recursive flag. No other behaviour changes other than if you provide the -r flag with an alias but no bucket specified. Previously this would have listed just the buckets (same as without the flag), now it lists all objects on the server.
Closes #47